package action;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.http.HttpServletResponse;

import com.opensymphony.xwork2.ActionContext;
import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.fastjson.JSON;

import lombok.Data;
import pojo.SysMenus;
import service.SysMenusService;
@Data
public class SysMenusAction {
    @Autowired
    private SysMenusService services;


    public String queryMenus() throws Exception {
        List<SysMenus> queryMenu= services.queryMenu(7);
        ActionContext.getContext().getSession().put("queryMenu", queryMenu);
        return "querymenutwo";

    }
    public String queryMenusTwo() throws Exception {
        List<SysMenus> sysMenus = services.queryMenuTwo(7);
        ActionContext.getContext().getSession().put("sysMenus",sysMenus);
        return "success";
    }

    public String queryMenus2() throws Exception {
        List<SysMenus> queryMenu= services.queryMenu(1);
        ActionContext.getContext().getSession().put("queryMenu2", queryMenu);
        return "querymenutwo2";

    }
    public String queryMenusTwo2() throws Exception {
        List<SysMenus> sysMenus = services.queryMenuTwo(1);
        ActionContext.getContext().getSession().put("sysMenus2",sysMenus);
        return "successs";
    }

    public String queryMenus3() throws Exception {
        List<SysMenus> queryMenu= services.queryMenu(5);
        ActionContext.getContext().getSession().put("queryMenu3", queryMenu);
        return "querymenutwo3";

    }
    public String queryMenusTwo3() throws Exception {
        List<SysMenus> sysMenus = services.queryMenuTwo(5);
        ActionContext.getContext().getSession().put("sysMenus3",sysMenus);
        return "successss";
    }

}
